package com.wxsong.test.nacos.zkprovider.soa;

import com.alibaba.fastjson.JSONArray;
import com.wxsong.test.nacos.api.UserApi;
import com.wxsong.test.nacos.model.user.User;
import com.wxsong.test.nacos.service.user.UserService;

import javax.annotation.Resource;

/**
 * 描述：
 *
 * @Author songweixing
 * @Date 2020/1/2
 */
public class UserApiImpl implements UserApi {

    @Resource
    UserService userService;

    @Override
    public String userList() {
        JSONArray jsonArray = userService.userList();
        return jsonArray.toJSONString();
    }

    @Override
    public User findUser(String userNo) {
        Double d = Math.random()*100;
        User user = new User(userNo, userNo+"-Name", d.intValue());
        return user;
    }

}
